Skip to content

Comments

DM-51248: Raise error if no kernel candidates remain after max iterations#405

Merged
isullivan merged 2 commits intomainfrom
tickets/DM-51248
Jun 4, 2025
Merged

DM-51248: Raise error if no kernel candidates remain after max iterations#405
isullivan merged 2 commits intomainfrom
tickets/DM-51248

Conversation

@isullivan
Copy link
Contributor

No description provided.

Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, procedural points only.


if spatialkv.getNCandidates() < 1:
# Run after the final fit to use the updated kernel visitor `spatialkv`
raise RuntimeError("No kernel candidates remain after max iterations")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an AlgorithmError or something fancier? I don't know what the rules are for task exceptions these days.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that would be better. I should convert the similar RuntimeError into one as well.

spatialKernel, spatialBackground = spatialkv.getSolutionPair()

if spatialkv.getNCandidates() < 1:
# Run after the final fit to use the updated kernel visitor `spatialkv`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this comment the first time around; I think putting it before the if might make it more obvious (since it refers to the whole block).

@isullivan isullivan merged commit c0de477 into main Jun 4, 2025
5 checks passed
@isullivan isullivan deleted the tickets/DM-51248 branch June 4, 2025 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants